package com.example.zhihuigongdi.controller;


import com.example.zhihuigongdi.entity.Personnel;
import com.example.zhihuigongdi.entity.Recordings;
import com.example.zhihuigongdi.entity.respon.Result;
import com.example.zhihuigongdi.service.IRecordingsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author liuhongbin
 * @since 2024-04-17
 */
@RestController
@RequestMapping("/recordings")
public class RecordingsController {

    @Autowired
    @Lazy
    private IRecordingsService recordingsService;

    @PostMapping("/list/{current}/{size}")
    public Result list(@PathVariable int current, @PathVariable int size){
        return recordingsService.getRecordings(current,size);
    }

    @PostMapping("/add")
    public Result add(@RequestBody Recordings recordings){
        return recordingsService.addRecording(recordings);
    }

    @PostMapping("/add/{recording_id}")
    public Result remove(@PathVariable int recording_id ){
        return recordingsService.removeRecording(recording_id);
    }
}
